package com.lak.nagivation.cal;

import com.lak.nagivation.bean.Environments;
import com.lak.nagivation.bean.Road;
import com.lak.nagivation.bean.Truck;

public class GetDll {
static{
    System.loadLibrary("calculator");
//    System.load("D:\\nagivation\\nagivation\\calculator.dll");
}

    /**
     * @description
     * @params [truck, roads, env, polyline]
     * @return
     * @author  lj
     * @date  2020/7/21 20:22
     *
     */
    public native static  String[] checkPass1(Truck truck, Road[] roads, Environments env);
    public native static  String[] checkPass2(Truck truck, Road[] roads, Environments env,String[] polyline);
    public native static  String[] checkPass3(Truck truck, Road[] roads, Environments env,String[] points);
    public native static  String[] checkPass4(Truck truck, Road[] roads, Environments env,String[] Features);



    //    public native static  String[] checkPass5(Truck truck, Road[] roads, Environments env);


    //测试用
    public native static void set(int i);
    public native static int get();
    public static void main(String[] args) {
        set(100);
        System.out.println(get());

        Truck truck=new Truck();
        Environments env=new Environments();
        Road[] roads=new Road[2];
        roads[0]=new Road();
        roads[1]=new Road();
        //String[] road={"","南焦路","顺平路","回民营桥","回民营桥"};
        String[] road={"","南焦路"};
        String[] p1=new String[2];
        p1[0]="116.609701,40.127248,116.610069,40.125356,116.610603,40.122622,116.610638,40.122413,116.610651,40.122374,116.610707,40.12207,116.610938,40.120859,116.611016,40.12053,116.611042,40.120404,116.611068,40.120308,116.611202,40.119666,116.61125,40.119414,116.611372,40.118854,116.611593,40.118025,116.611688,40.117721" ;
        p1[1]="116.611688,40.117721,116.610638,40.117734,116.609514,40.11776,116.608885,40.117778,116.606567,40.117808,116.604019,40.117856,116.602765,40.117873,116.60174,40.117904,116.598785,40.117956,116.597231,40.117986,116.597057,40.11799,116.595616,40.118012,116.592287,40.118077,116.59013,40.118095,116.588859,40.118103,116.587878,40.118073";
        String[] polyline={"116.461593,40.091411,116.461597,40.091563,116.461597,40.091563,116.461589,40.092587"};
//        HttpPretreatment.pretreatment(road);
        Road[] RS=CoreCal.pretreatment_Road(road,p1);
        String[] sss=checkPass1(truck, RS, env);

        String[] polyline1={"120.101099","36.010338","116.461593","40.091411","116.461597","40.091563","116.461597","40.091563","116.461589","40.092587"};
        String[] polyline_de=CoreCal.pretreatment_Polyline(polyline1);

        //String[] sss2=checkPass2(truck, RS, env,polyline_de);//0,116.610638,40.122413;   情况，经度，维度，(具体数组)
        String[] sss3=checkPass3(truck, RS, env,polyline_de);
//        System.out.println(sss[0]);
//        System.out.println(sss[1]);
//        System.out.println(sss[2]);
        //System.out.println(sss2[0]);
        System.out.println(sss3[0]);
    }
}